﻿using System;
using System.Collections.Generic;
using Sparkle.Hosting;
using Sparkle.Wpf.Demo.UI.MenuEntities;

namespace Sparkle.Wpf.Demo.UI.Attributes
{
    [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
    public class LinkNotesAttribute : DynamicLinkAttribute, IEntityAttribute
    {
        public int EntityId  { get;  set; }

        public string Title { get; set; }

        public LinkNotesAttribute()
        {
            
        }
        public LinkNotesAttribute(string title, int entityId)
        {
            Title = title;
            EntityId = entityId;
        }

        public override string ToString()
        {
            return Title;
        }

        public override IList<object> GetDynamicLinks(object refEntity)
        {
            var retuList = new List<object>
                               {
                                   new LinkNote { Note = refEntity + "Details"  },
                                    new LinkNote { Note = refEntity + "Holidays"},
                                    new LinkNote { Note = refEntity +"Sickness"}
                               };

            return retuList;
        }
    }
}